<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
    <link href="<?= HTTP_IMAGES_PATH_ADMIN ?>favicon.ico" type="image/x-icon" rel="icon"/>
    <link href="<?= HTTP_IMAGES_PATH_ADMIN ?>favicon.ico" type="image/x-icon" rel="shortcut icon"/>
    <!--CSS-->
    <link href="<?php echo HTTP_CSS_PATH; ?>bootstrap.css" rel="stylesheet">
    <link href="<?php echo HTTP_CSS_PATH; ?>font-awesome.css" rel="stylesheet">
    <link href="<?php echo HTTP_CSS_PATH_ADMIN; ?>styles.css" rel="stylesheet">
    <!--  JS  -->
    <script type="text/javascript">
        var root = '<?= PATH_URL ?>';
        <?php if ($this->uri->segment(2) != 'update_profile' && $this->uri->segment(2) != 'setting') { ?>
        var module = '<?= $module ?>';
        <?php } ?>
    </script>
    <script type="text/javascript" src="<?= HTTP_JS_PATH . 'jquery-1.8.1.min.js' ?>"></script>
    <script type="text/javascript" src="<?= HTTP_JS_PATH . 'jquery-ui-1.8.16.custom.min.js' ?>"></script>
    <script type="text/javascript" src="<?= PATH_URL . 'assets/editor/scripts/innovaeditor.js' ?>"></script>
    <script type="text/javascript" src="<?= HTTP_JS_PATH_ADMIN . 'jquery.ToTop.js' ?>"></script>
    <script type="text/javascript" src="<?= HTTP_JS_PATH_ADMIN . 'jquery_caledar.js' ?>"></script>
    <script type="text/javascript" src="<?= HTTP_JS_PATH_ADMIN . 'custom_forms.js' ?>"></script>
    <script type="text/javascript" src="<?= HTTP_JS_PATH_ADMIN . 'jquery.form.js' ?>"></script>
    <script type="text/javascript" src="<?= HTTP_JS_PATH_ADMIN . 'jquery.url.js' ?>"></script>
    <script type="text/javascript" src="<?= HTTP_JS_PATH_ADMIN . 'jquery.fancybox-1.3.4.pack.js' ?>"></script>
    <script type="text/javascript" src="<?= HTTP_JS_PATH_ADMIN . 'admin.js' ?>"></script>
    <title>Admin Control Panel</title>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="<?php echo HTTP_JS_PATH; ?>html5shiv.js"></script>
    <script src="<?php echo HTTP_JS_PATH; ?>respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="topNav">
    <div class="nameNav"><?= modules::run('admincp/getSetting', 'title-admincp') ?></div>
    <div class="userNav">
        <ul>
            <li class="profile"><a href="<?= PATH_URL . 'admincp/update_profile' ?>"><img alt="profile"
                                                                                          src="<?= HTTP_IMAGES_PATH_ADMIN . 'userPic.png' ?>"/><span><?= $this->session->userdata('userInfo') ?></span></a>
            </li>
            <li class="li_last_child"><a href="<?= PATH_URL . 'admincp/logout' ?>"><img alt="profile"
                                                                                        src="<?= HTTP_IMAGES_PATH_ADMIN . 'logout.png' ?>"/><span>Logout</span></a>
            </li>
        </ul>
    </div>
</div>
<?php
$pg = isset($page) && $page != '' ? $page : 'dash';
?>
<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand"
               href="<?php echo base_url(); ?>"><?= modules::run('admincp/getSetting', 'title-admincp') ?></a>
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li <?php if ($this->uri->segment(2) == ''){ ?>class="active"<?php } ?>><a
                        href="<?= PATH_URL . 'admincp' ?>"><span class="menu_dashboard">Dashboard</span></a>
                </li>
                <li <?php if ($this->uri->segment(2) == 'admincp_modules'){ ?>class="active"<?php } ?>><a
                        href="<?= PATH_URL . 'admincp/admincp_modules' ?>"><span class="">Modules</span></a>
                </li>
                <li class="dropdown <?php if ($this->uri->segment(2) == 'introduction' || $this->uri->segment(2) == 'gallery' || $this->uri->segment(2) == 'news') { ?>active<?php } ?>">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Content<b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li <?php if ($this->uri->segment(2) == 'introduction'){ ?>class="active"<?php } ?>><a
                                href="<?= PATH_URL . 'admincp/introduction' ?>"><i class="fa fa-angle-right"> </i> Basic
                                pages</a></li>
                        <li class="divider"></li>
                        <li <?php if ($this->uri->segment(2) == 'gallery'){ ?>class="active"<?php } ?>><a
                                href="<?= PATH_URL . 'admincp/gallery' ?>"><i class="fa fa-angle-right"> </i>
                                Gallery</a></li>
                        <li class="divider"></li>
                        <li <?php if ($this->uri->segment(2) == 'news'){ ?>class="active"<?php } ?>><a
                                href="<?= PATH_URL . 'admincp/news' ?>"><i class="fa fa-angle-right"> </i> Article</a>
                        </li>
                        <li class="divider"></li>
                        <li <?php if ($this->uri->segment(2) == 'books'){ ?>class="active"<?php } ?>><a
                                href="<?= PATH_URL . 'admincp/books' ?>"><i class="fa fa-angle-right"> </i> Books</a>
                        <li <?php if ($this->uri->segment(2) == 'category_books'){ ?>class="active"<?php } ?>><a
                                href="<?= PATH_URL . 'admincp/category_books' ?>"><i class="fa fa-angle-right"> </i>
                                Category books</a>

                    </ul>
                </li>
                <li class="dropdown <?php if ($this->uri->segment(2) == 'admincp_accounts' || $this->uri->segment(2) == 'admincp_account_groups') { ?>active<?php } ?>">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">User<b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li <?php if ($this->uri->segment(2) == 'admincp_accounts'){ ?>class="active"<?php } ?>><a
                                href="<?= PATH_URL . 'admincp/admincp_accounts' ?>"><i class="fa fa-angle-right"> </i>
                                List user</a></li>
                        <li class="divider"></li>
                        <li <?php if ($this->uri->segment(2) == 'admincp_account_groups'){ ?>class="active"<?php } ?>><a
                                href="<?= PATH_URL . 'admincp/admincp_account_groups' ?>"><i
                                    class="fa fa-angle-right"> </i> Group</a></li>
                    </ul>
                </li>
                <li <?php if ($this->uri->segment(2) == 'admincp_logs'){ ?>class="active"<?php } ?>><a
                        href="<?= PATH_URL . 'admincp/admincp_logs' ?>"><span class="">Logs</span></a>
                </li>
                <li><a <?php if ($this->uri->segment(2) == 'setting'){ ?>class="active"<?php } ?>
                       href="<?= PATH_URL . 'admincp/setting' ?>"><span class=><i class="fa fa-cog"></i> Setting</span></a>
                </li>

            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i
                            class="fa fa-user"></i> <?= $this->session->userdata('userInfo') ?><b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li><a href="<?= PATH_URL . 'admincp/update_profile' ?>"><i class="fa fa-user"></i> Profile</a>
                        </li>
                        <li class="divider"></li>
                        <li><a href="<?php echo base_url(); ?>admincp/logout"><i class="fa fa-power-off"></i> Logout</a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</div>

<div class="page-header container">
    <div class="row">
        <?php $pg = isset($module_name) && $module_name != '' ? $module_name : 'Dashboard' ?>
        <div class="col-lg-6">
            <h1>
                <small><?= $pg ?></small>

            </h1>
        </div>
        <div class="col-lg-6">
            <?php if ($this->uri->segment(2) != 'permission') { ?>
                <div class="midNav">
                    <?php
                    if ($this->uri->segment(3) != 'update' && $this->uri->segment(2) != 'update_profile' && $this->uri->segment(2) != 'setting') {
                        if ($this->uri->segment(2) != 'manager_modules' && $this->uri->segment(2) != 'logs') {
                            ?>
                            <ul>
                                <?php if ($this->uri->segment(2) != 'contact') { ?>
                                    <li><a href="<?= PATH_URL . 'admincp/' . $module . '/update/' ?>"><span
                                                class="fa fa-edit"></span></a>
                                    </li>
                                    <li><a href="javascript:void(0)" onclick="showStatusAll()"><span
                                                class="fa fa-check"></span></a></li>
                                    <li><a href="javascript:void(0)" onclick="hideStatusAll()"><span
                                                class="fa fa-times"></span></a></li>
                                <?php } ?>
                                <li class="midNav_last_child"><a href="javascript:void(0)" onclick="deleteAll()"><span
                                            class="fa fa-trash-o"></span></a></li>
                            </ul>
                        <?php
                        }
                    } else {
                        ?>
                        <ul>
                            <?php if ($this->uri->segment(2) != 'update_profile' && $this->uri->segment(2) != 'setting') { ?>
                                <li <?php ($this->uri->segment(2) == 'contact') ? print 'class="midNav_last_child"' : print '' ?>>
                                    <a href="<?= PATH_URL . 'admincp/' . $module . '/#/back' ?>"><span
                                            class="fa fa-reply"></span></a>
                                </li>
                            <?php } ?>

                            <?php if ($this->uri->segment(2) == 'accounts' && $this->uri->segment(4) != '') { ?>
                                <li><a href="javascript:void(0)" onclick="resetPerm()"><span
                                            class="reset">Reset Permission</span></a></li>
                            <?php } ?>

                            <?php if ($this->uri->segment(2) != 'contact') { ?>
                                <li class="midNav_last_child"><a href="javascript:void(0)" onclick="save()"><span
                                            id="saveContent" class="fa fa-save"></span></a></li>
                            <?php } ?>
                        </ul>
                    <?php } ?>
                </div>
            <?php } ?>
        </div>
    </div>
</div>
<div class="container">
    <div id="content">
        <table cellspacing="0" cellpadding="0" border="0" width="100%">
            <tr>
                <td valign="top">
                    <div class="right_content">
                        <?= $content ?>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</div>
<!-- /.container -->
<hr>
<footer>
    <div class="container">
        <p>&copy; Company 2013. ANN Admin Control Panel</p></div>
</footer>
</div>
<!-- /container -->

<!-- Placed at the end of the document so the pages load faster -->
<script src="<?php echo HTTP_JS_PATH; ?>bootstrap.min.js"></script>

<div id="loader">
    <div class="bg_mask"></div>
    <div class="processing">
        <div class="bg_processing"><img alt="Loading"
                                        src="<?= HTTP_IMAGES_PATH_ADMIN . 'ajax-loader.gif' ?>"/><br/>System is
            processing...
        </div>
    </div>
</div>
</body>
</html>